package com.youchuang.redistest.service;

import java.util.List;

import org.springframework.data.redis.connection.RedisConnection;

import com.youchuang.redistest.dao.BaseDAO;
import com.youchuang.redistest.util.PropertiesUtil;
import com.youchuang.redistest.util.RedisCacheSearchBuilder;

public interface CacheService<T, D extends BaseDAO<T>> {

	// 指定一个前缀，避免与其他项目搞混
	public static final String CACHE_PREFIX = PropertiesUtil.getValue("cache.properties", "redis.cache.prefix");

	public static final String CACHE_LIST = "list";

	public void save(T bean);

	public void update(T bean);

	public void delete(String id);

	public int deleteByIds(List<String> ids);

	public T get(String id);

	public List<T> selectByParams(RedisCacheSearchBuilder builder);

	public String getSearchKeySet();

	public void clearSrchKey(String srchKeyMap, RedisConnection connection);

}
